﻿using DivisonsCodeTools.Business.Configure;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DivisonsCodeTools.Frm
{
    public partial class FrmMariadbTools : Form
    {
        public FrmMariadbTools()
        {
            InitializeComponent();
        }

        private void FrmMariadbTools_Load(object sender, EventArgs e)
        {
            this.textBox1.Text = Business.Configure.Config.GetInstance().MariadbConnectionString;
            this.textBox2.Text = Business.Configure.Config.GetInstance().MariadbTableName;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.textBox1.Text))
                Business.Configure.Config.GetInstance().MariadbConnectionString = this.textBox1.Text.Trim();
            if (!string.IsNullOrEmpty(this.textBox2.Text))
                Business.Configure.Config.GetInstance().MariadbTableName = this.textBox2.Text.Trim();
            AppConfig.Save(Config.GetInstance());
            MessageBox.Show("已经保存");
            this.Close();
        }
    }
}
